#include "stdafx.h"
#include "Explorer.h"
#include "XTPTabControlEx.h"

CXTPTabControlEx::CXTPTabControlEx(void)
{
}

CXTPTabControlEx::~CXTPTabControlEx(void)
{
}

BEGIN_MESSAGE_MAP(CXTPTabControlEx, CXTPTabControl)
	//{{AFX_MSG_MAP(CXTPTabControlEx)
	ON_WM_RBUTTONDOWN()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CXTPTabControlEx::OnRButtonDown(UINT nFlags, CPoint point)
{
	OnLButtonDown(nFlags, point);

	CMenu menu;
	VERIFY(menu.LoadMenu(IDR_Popup_SubTabs));
	CMenu* pPopup = menu.GetSubMenu(0);
	if(pPopup == NULL)
		return;

	CPoint pos;
	GetCursorPos(&pos);
	CXTPCommandBars::TrackPopupMenu(pPopup, TPM_RIGHTBUTTON, pos.x, pos.y, AfxGetMainWnd());
}
